import { createApp } from 'vue'

import App from './App.vue'
import store from './store';
import VCalendar from 'v-calendar';
import axios from 'axios';

axios.defaults.baseURL = import.meta.env.VITE_API_URL;
/**
 * axios拦截器
 */
axios.interceptors.request.use(function (config) {
    console.log('请求参数：', config);
    // const token = 获取用户在浏览器本地的token
    // if (token) {
    //     config.headers.token = token;
    //     console.log("请求headers增加token:", token);
    // }
    return config;
}, error => {
    return Promise.reject(error);
});

import router from './router/index.js'

//use(router) 将Vue Router实例注册到Vue应用中
createApp(App).use(router).use(store).use(VCalendar, {
    componentPrefix: 'vc' // 可选：自定义组件前缀
}).mount('#app')

